
<!DOCTYPE HTML>
<html lang="en" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>与SQL比较 · InfluxDB中文文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="jasper">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-comment/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="insights_tradeoffs.html" />
    
    
    <link rel="prev" href="glossary.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://legacy.gitbook.com/book/jasper-zhang1/influxdb" target="_blank" class="custom-link">InfluxDB中文文档</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Introduction/">
            
                <a href="../Introduction/">
            
                    
                    介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../Introduction/installation.html">
            
                <a href="../Introduction/installation.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../Introduction/getting_start.html">
            
                <a href="../Introduction/getting_start.html">
            
                    
                    入门指南
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../Guide/">
            
                <a href="../Guide/">
            
                    
                    使用指南
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Guide/writing_data.html">
            
                <a href="../Guide/writing_data.html">
            
                    
                    写入数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../Guide/querying_data.html">
            
                <a href="../Guide/querying_data.html">
            
                    
                    查询数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../Guide/downsampling_and_retention.html">
            
                <a href="../Guide/downsampling_and_retention.html">
            
                    
                    采样和数据保留
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../Guide/hardware_sizing.html">
            
                <a href="../Guide/hardware_sizing.html">
            
                    
                    硬件指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../Guide/https_setup.html">
            
                <a href="../Guide/https_setup.html">
            
                    
                    HTTPS设置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="./">
            
                <a href="./">
            
                    
                    概念介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="key_concepts.html">
            
                <a href="key_concepts.html">
            
                    
                    关键概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="glossary.html">
            
                <a href="glossary.html">
            
                    
                    专业术语
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.3" data-path="crosswalk.html">
            
                <a href="crosswalk.html">
            
                    
                    与SQL比较
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="insights_tradeoffs.html">
            
                <a href="insights_tradeoffs.html">
            
                    
                    InfluxDB的设计见解和权衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="schema_and_data_layout.html">
            
                <a href="schema_and_data_layout.html">
            
                    
                    schema设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="storage_engine.html">
            
                <a href="storage_engine.html">
            
                    
                    存储引擎
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../Write_protocols/">
            
                <a href="../Write_protocols/">
            
                    
                    写入协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Write_protocols/line_protocol.html">
            
                <a href="../Write_protocols/line_protocol.html">
            
                    
                    行协议
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../Query_language/">
            
                <a href="../Query_language/">
            
                    
                    查询语言
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../Query_language/data_exploration.html">
            
                <a href="../Query_language/data_exploration.html">
            
                    
                    数据查询语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../Query_language/schema_exploration.html">
            
                <a href="../Query_language/schema_exploration.html">
            
                    
                    schema查询语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../Query_language/database_management.html">
            
                <a href="../Query_language/database_management.html">
            
                    
                    数据库管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../Query_language/continuous_queries.html">
            
                <a href="../Query_language/continuous_queries.html">
            
                    
                    连续查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../Query_language/functions.html">
            
                <a href="../Query_language/functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../Query_language/math_operators.html">
            
                <a href="../Query_language/math_operators.html">
            
                    
                    数学运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../Query_language/authentication_and_authorization.html">
            
                <a href="../Query_language/authentication_and_authorization.html">
            
                    
                    认证和授权
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../Troubleshooting/">
            
                <a href="../Troubleshooting/">
            
                    
                    故障排除
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../Troubleshooting/faq.html">
            
                <a href="../Troubleshooting/faq.html">
            
                    
                    FAQ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../Troubleshooting/system_monitor.html">
            
                <a href="../Troubleshooting/system_monitor.html">
            
                    
                    系统监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../Troubleshooting/query_management.html">
            
                <a href="../Troubleshooting/query_management.html">
            
                    
                    查询管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../Troubleshooting/error_messages.html">
            
                <a href="../Troubleshooting/error_messages.html">
            
                    
                    错误信息
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >与SQL比较</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x4E0E;sql&#x6BD4;&#x8F83;">&#x4E0E;SQL&#x6BD4;&#x8F83;</h1>
<h2 id="database&#x91CC;&#x9762;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;">database&#x91CC;&#x9762;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</h2>
<p>&#x8BE5;&#x7AE0;&#x5411;SQL&#x7528;&#x6237;&#x4ECB;&#x7ECD;&#x4E86;InfluxDB&#x54EA;&#x91CC;&#x50CF;SQL&#x6570;&#x636E;&#x5E93;&#x4EE5;&#x53CA;&#x5B83;&#x54EA;&#x91CC;&#x4E0D;&#x50CF;&#x3002;&#x5C06;&#x7A81;&#x51FA;&#x8BB2;&#x4E86;&#x4E24;&#x8005;&#x4E4B;&#x95F4;&#x7684;&#x4E00;&#x4E9B;&#x4E3B;&#x8981;&#x533A;&#x522B;&#xFF0C;&#x5E76;&#x63D0;&#x4F9B;&#x4E86;&#x4E0D;&#x540C;&#x7684;&#x6570;&#x636E;&#x5E93;&#x672F;&#x8BED;&#x548C;&#x67E5;&#x8BE2;&#x8BED;&#x8A00;&#x3002;</p>
<h3 id="&#x4E00;&#x822C;&#x6765;&#x8BF4;">&#x4E00;&#x822C;&#x6765;&#x8BF4;</h3>
<p>InfluxDB&#x662F;&#x4E00;&#x4E2A;&#x65F6;&#x95F4;&#x5E8F;&#x5217;&#x6570;&#x636E;&#x5E93;&#xFF0C;SQL&#x6570;&#x636E;&#x5E93;&#x53EF;&#x4EE5;&#x63D0;&#x4F9B;&#x65F6;&#x5E8F;&#x7684;&#x529F;&#x80FD;&#xFF0C;&#x4F46;&#x4E25;&#x683C;&#x8BF4;&#x65F6;&#x5E8F;&#x4E0D;&#x662F;&#x5176;&#x76EE;&#x7684;&#x3002;&#x7B80;&#x800C;&#x8A00;&#x4E4B;&#xFF0C;InfluxDB&#x7528;&#x4E8E;&#x5B58;&#x50A8;&#x5927;&#x91CF;&#x7684;&#x65F6;&#x95F4;&#x5E8F;&#x5217;&#x6570;&#x636E;&#xFF0C;&#x5E76;&#x5BF9;&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x5FEB;&#x901F;&#x7684;&#x5B9E;&#x65F6;&#x5206;&#x6790;&#x3002;</p>
<h3 id="&#x65F6;&#x95F4;&#x662F;&#x4E00;&#x5207;">&#x65F6;&#x95F4;&#x662F;&#x4E00;&#x5207;</h3>
<p>&#x5728;InfluxDB&#x4E2D;&#xFF0C;timestamp&#x6807;&#x8BC6;&#x4E86;&#x5728;&#x4EFB;&#x4F55;&#x7ED9;&#x5B9A;&#x6570;&#x636E;series&#x4E2D;&#x7684;&#x5355;&#x4E2A;&#x70B9;&#x3002;&#x8FD9;&#x5C31;&#x50CF;&#x4E00;&#x4E2A;SQL&#x6570;&#x636E;&#x5E93;&#x8868;&#xFF0C;&#x5176;&#x4E2D;&#x4E3B;&#x952E;&#x662F;&#x7531;&#x7CFB;&#x7EDF;&#x9884;&#x5148;&#x8BBE;&#x7F6E;&#x7684;&#xFF0C;&#x5E76;&#x4E14;&#x59CB;&#x7EC8;&#x662F;&#x65F6;&#x95F4;&#x3002;</p>
<p>InfluxDB&#x8FD8;&#x4F1A;&#x8BA4;&#x8BC6;&#x5230;&#x60A8;&#x7684;schema&#x53EF;&#x80FD;&#x968F;&#x65F6;&#x95F4;&#x800C;&#x6539;&#x53D8;&#x3002;&#x5728;InfluxDB&#x4E2D;&#xFF0C;&#x60A8;&#x4E0D;&#x9700;&#x8981;&#x5728;&#x524D;&#x9762;&#x5B9A;&#x4E49;schema&#x3002;&#x6570;&#x636E;&#x70B9;&#x53EF;&#x4EE5;&#x6709;&#x4E00;&#x4E2A;measurement&#x7684;field&#x7684;&#x4E00;&#x4E2A;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x6709;&#x8FD9;&#x4E2A;measurement&#x7684;&#x6240;&#x6709;field&#xFF0C;&#x6216;&#x5176;&#x95F4;&#x7684;&#x4EFB;&#x4F55;&#x6570;&#x5B57;&#x3002; &#x60A8;&#x53EF;&#x4EE5;&#x5728;&#x5199;&#x6570;&#x636E;&#x7684;&#x65F6;&#x5019;&#x4E3A;&#x8BE5;measurement&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x65B0;&#x7684;field&#x3002;</p>
<h2 id="&#x672F;&#x8BED;">&#x672F;&#x8BED;</h2>
<p>&#x4E0B;&#x8868;&#x662F;&#x4E00;&#x4E2A;&#x53EB;<code>foodships</code>&#x7684;SQL&#x6570;&#x636E;&#x5E93;&#x7684;&#x4F8B;&#x5B50;&#xFF0C;&#x5E76;&#x6709;&#x6CA1;&#x6709;&#x7D22;&#x5F15;&#x7684;<code>#_foodships</code>&#x5217;&#x548C;&#x6709;&#x7D22;&#x5F15;&#x7684;<code>park_id</code>,<code>planet</code>&#x548C;<code>time</code>&#x5217;&#x3002;</p>
<table>
<thead>
<tr>
<th>park_id</th>
<th>planet</th>
<th>time</th>
<th>#_foodships</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Earth</td>
<td>1429185600000000000</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>Earth</td>
<td>1429185601000000000</td>
<td>3</td>
</tr>
<tr>
<td>1</td>
<td>Earth</td>
<td>1429185602000000000</td>
<td>15</td>
</tr>
<tr>
<td>1</td>
<td>Earth</td>
<td>1429185603000000000</td>
<td>15</td>
</tr>
<tr>
<td>2</td>
<td>Saturn</td>
<td>1429185600000000000</td>
<td>5</td>
</tr>
<tr>
<td>2</td>
<td>Saturn</td>
<td>1429185601000000000</td>
<td>9</td>
</tr>
<tr>
<td>2</td>
<td>Saturn</td>
<td>1429185602000000000</td>
<td>10</td>
</tr>
<tr>
<td>2</td>
<td>Saturn</td>
<td>1429185603000000000</td>
<td>14</td>
</tr>
<tr>
<td>3</td>
<td>Jupiter</td>
<td>1429185600000000000</td>
<td>20</td>
</tr>
<tr>
<td>3</td>
<td>Jupiter</td>
<td>1429185601000000000</td>
<td>21</td>
</tr>
<tr>
<td>3</td>
<td>Jupiter</td>
<td>1429185602000000000</td>
<td>21</td>
</tr>
<tr>
<td>3</td>
<td>Jupiter</td>
<td>1429185603000000000</td>
<td>20</td>
</tr>
<tr>
<td>4</td>
<td>Saturn</td>
<td>1429185600000000000</td>
<td>5</td>
</tr>
<tr>
<td>4</td>
<td>Saturn</td>
<td>1429185601000000000</td>
<td>5</td>
</tr>
<tr>
<td>4</td>
<td>Saturn</td>
<td>1429185602000000000</td>
<td>6</td>
</tr>
<tr>
<td>4</td>
<td>Saturn</td>
<td>1429185603000000000</td>
<td>5</td>
</tr>
</tbody>
</table>
<p>&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x5728;InfluxDB&#x770B;&#x8D77;&#x6765;&#x5C31;&#x50CF;&#x8FD9;&#x6837;&#xFF1A;</p>
<pre><code>name: foodships
tags: park_id=1, planet=Earth
time                           #_foodships
----                           ------------
2015-04-16T12:00:00Z     0
2015-04-16T12:00:01Z     3
2015-04-16T12:00:02Z     15
2015-04-16T12:00:03Z     15

name: foodships
tags: park_id=2, planet=Saturn
time                           #_foodships
----                           ------------
2015-04-16T12:00:00Z     5
2015-04-16T12:00:01Z     9
2015-04-16T12:00:02Z     10
2015-04-16T12:00:03Z     14

name: foodships
tags: park_id=3, planet=Jupiter
time                           #_foodships
----                           ------------
2015-04-16T12:00:00Z     20
2015-04-16T12:00:01Z     21
2015-04-16T12:00:02Z     21
2015-04-16T12:00:03Z     20

name: foodships
tags: park_id=4, planet=Saturn
time                           #_foodships
----                           ------------
2015-04-16T12:00:00Z     5
2015-04-16T12:00:01Z     5
2015-04-16T12:00:02Z     6
2015-04-16T12:00:03Z     5
</code></pre><p>&#x53C2;&#x8003;&#x4E0A;&#x9762;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x4E00;&#x822C;&#x53EF;&#x4EE5;&#x8FD9;&#x4E48;&#x8BF4;&#xFF1A;</p>
<ul>
<li>InfluxDB&#x7684;measurement(<code>foodships</code>)&#x548C;SQL&#x6570;&#x636E;&#x5E93;&#x91CC;&#x7684;table&#x7C7B;&#x4F3C;&#xFF1B;</li>
<li>InfluxDB&#x7684;tag(<code>park_id</code>&#x548C;<code>planet</code>)&#x7C7B;&#x4F3C;&#x4E8E;SQL&#x6570;&#x636E;&#x5E93;&#x91CC;&#x7D22;&#x5F15;&#x7684;&#x5217;&#xFF1B;</li>
<li>InfluxDB&#x4E2D;&#x7684;field(<code>#_foodships</code>)&#x7C7B;&#x4F3C;&#x4E8E;SQL&#x6570;&#x636E;&#x5E93;&#x91CC;&#x6CA1;&#x6709;&#x7D22;&#x5F15;&#x7684;&#x5217;&#xFF1B;</li>
<li>InfluxDB&#x91CC;&#x9762;&#x7684;&#x6570;&#x636E;&#x70B9;(&#x4F8B;&#x5982;<code>2015-04-16T12:00:00Z     5</code>)&#x7C7B;&#x4F3C;&#x4E8E;SQL&#x6570;&#x636E;&#x5E93;&#x7684;&#x884C;&#xFF1B;</li>
</ul>
<p>&#x57FA;&#x4E8E;&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x5E93;&#x672F;&#x8BED;&#x7684;&#x6BD4;&#x8F83;&#xFF0C;InfluxDB&#x7684;continuous query&#x548C;retention policy&#x4E0E;SQL&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x7684;&#x5B58;&#x50A8;&#x8FC7;&#x7A0B;&#x7C7B;&#x4F3C;&#x3002; &#x5B83;&#x4EEC;&#x88AB;&#x6307;&#x5B9A;&#x4E00;&#x6B21;&#xFF0C;&#x7136;&#x540E;&#x5B9A;&#x671F;&#x81EA;&#x52A8;&#x6267;&#x884C;&#x3002;</p>
<p>&#x5F53;&#x7136;&#xFF0C;SQL&#x6570;&#x636E;&#x5E93;&#x548C;InfluxDB&#x4E4B;&#x95F4;&#x5B58;&#x5728;&#x4E00;&#x4E9B;&#x91CD;&#x5927;&#x5DEE;&#x5F02;&#x3002;SQL&#x4E2D;&#x7684;<code>JOIN</code>&#x4E0D;&#x9002;&#x7528;&#x4E8E;InfluxDB&#x4E2D;&#x7684;measurement&#x3002;&#x800C;&#x4E14;&#xFF0C;&#x6B63;&#x5982;&#x6211;&#x4EEC;&#x4E0A;&#x9762;&#x63D0;&#x5230;&#x7684;&#x90A3;&#x6837;&#xFF0C;&#x4E00;&#x4E2A;measurement&#x5C31;&#x50CF;&#x4E00;&#x4E2A;SQL&#x7684;table&#xFF0C;&#x5176;&#x4E2D;&#x4E3B;&#x7D22;&#x5F15;&#x603B;&#x662F;&#x88AB;&#x9884;&#x8BBE;&#x4E3A;&#x65F6;&#x95F4;&#x3002;InfluxDB&#x7684;&#x65F6;&#x95F4;&#x6233;&#x8BB0;&#x5FC5;&#x987B;&#x5728;UNIX epoch&#xFF08;GMT&#xFF09;&#x6216;&#x683C;&#x5F0F;&#x5316;&#x4E3A;&#x65E5;&#x671F;&#x65F6;&#x95F4;RFC3339&#x683C;&#x5F0F;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x624D;&#x6709;&#x6548;&#x3002;</p>
<p>&#x67E5;&#x770B;&#x66F4;&#x591A;&#x5173;&#x4E8E;InfluxDB&#x7684;&#x672F;&#x8BED;&#x7684;&#x8BE6;&#x7EC6;&#x89E3;&#x91CA;&#xFF0C;&#x8BF7;&#x53C2;&#x8003;<a href="glossary.html">&#x4E13;&#x4E1A;&#x672F;&#x8BED;</a>&#x3002;</p>
<h2 id="influxql&#x548C;sql">InfluxQL&#x548C;SQL</h2>
<p>&#x5728;InfluxDB&#x4E2D;InfluxQL&#x662F;&#x4E00;&#x79CD;&#x7C7B;SQL&#x7684;&#x8BED;&#x8A00;&#x3002;&#x5BF9;&#x4E8E;&#x6765;&#x81EA;&#x5176;&#x4ED6;SQL&#x6216;&#x7C7B;SQL&#x73AF;&#x5883;&#x7684;&#x7528;&#x6237;&#x6765;&#x8BF4;&#xFF0C;&#x5B83;&#x5DF2;&#x7ECF;&#x88AB;&#x7CBE;&#x5FC3;&#x8BBE;&#x8BA1;&#xFF0C;&#x800C;&#x4E14;&#x8FD8;&#x63D0;&#x4F9B;&#x7279;&#x5B9A;&#x4E8E;&#x5B58;&#x50A8;&#x548C;&#x5206;&#x6790;&#x65F6;&#x95F4;&#x5E8F;&#x5217;&#x6570;&#x636E;&#x7684;&#x529F;&#x80FD;&#x3002;</p>
<p>InfluxQL&#x7684;<code>select</code>&#x8BED;&#x53E5;&#x6765;&#x81EA;&#x4E8E;SQL&#x4E2D;&#x7684;<code>select</code>&#x5F62;&#x5F0F;&#xFF1A;</p>
<pre><code>SELECT &lt;stuff&gt; FROM &lt;measurement_name&gt; WHERE &lt;some_conditions&gt;
</code></pre><p><code>where</code>&#x662F;&#x53EF;&#x9009;&#x7684;&#xFF0C;&#x5728;InfluxDB&#x91CC;&#x4E3A;&#x4E86;&#x67E5;&#x8BE2;&#x5230;&#x4E0A;&#x9762;&#x6570;&#x636E;&#xFF0C;&#x9700;&#x8981;&#x8F93;&#x5165;&#xFF1A;</p>
<pre><code>SELECT * FROM &quot;foodships&quot;
</code></pre><p>&#x5982;&#x679C;&#x4F60;&#x4EC5;&#x4EC5;&#x60F3;&#x770B;planet&#x4E3A;<code>Saturn</code>&#x7684;&#x6570;&#x636E;&#xFF1A;</p>
<pre><code>SELECT * FROM &quot;foodships&quot; WHERE &quot;planet&quot; = &apos;Saturn&apos;
</code></pre><p>&#x5982;&#x679C;&#x4F60;&#x60F3;&#x770B;&#x5230;planet&#x4E3A;<code>Saturn</code>&#xFF0C;&#x5E76;&#x4E14;&#x5728;UTC&#x65F6;&#x95F4;&#x4E3A;2015&#x5E74;4&#x6708;16&#x53F7;12:00:01&#x4E4B;&#x540E;&#x7684;&#x6570;&#x636E;&#xFF1A;</p>
<pre><code>SELECT * FROM &quot;foodships&quot; WHERE &quot;planet&quot; = &apos;Saturn&apos; AND time &gt; &apos;2015-04-16 12:00:01&apos;
</code></pre><p>&#x5982;&#x4E0A;&#x4F8B;&#x6240;&#x793A;&#xFF0C;InfluxQL&#x5141;&#x8BB8;&#x60A8;&#x5728;<code>WHERE</code>&#x5B50;&#x53E5;&#x4E2D;&#x6307;&#x5B9A;&#x67E5;&#x8BE2;&#x7684;&#x65F6;&#x95F4;&#x8303;&#x56F4;&#x3002;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x5305;&#x542B;&#x5355;&#x5F15;&#x53F7;&#x7684;&#x65E5;&#x671F;&#x65F6;&#x95F4;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x683C;&#x5F0F;&#x4E3A;YYYY-MM-DD HH&#xFF1A;MM&#xFF1A;SS.mmm&#xFF08;mmm&#x4E3A;&#x6BEB;&#x79D2;&#xFF0C;&#x4E3A;&#x53EF;&#x9009;&#x9879;&#xFF0C;&#x60A8;&#x8FD8;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x5FAE;&#x79D2;&#x6216;&#x7EB3;&#x79D2;&#x3002;&#x60A8;&#x8FD8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x76F8;&#x5BF9;&#x65F6;&#x95F4;&#x4E0E;<code>now()</code>&#x6765;&#x6307;&#x4EE3;&#x670D;&#x52A1;&#x5668;&#x7684;&#x5F53;&#x524D;&#x65F6;&#x95F4;&#x6233;&#xFF1A;</p>
<pre><code>SELECT * FROM &quot;foodships&quot; WHERE time &gt; now() - 1h
</code></pre><p>&#x8BE5;&#x67E5;&#x8BE2;&#x8F93;&#x51FA;measurement&#x4E3A;<code>foodships</code>&#x4E2D;&#x7684;&#x6570;&#x636E;&#xFF0C;&#x5176;&#x4E2D;&#x65F6;&#x95F4;&#x6233;&#x6BD4;&#x670D;&#x52A1;&#x5668;&#x5F53;&#x524D;&#x65F6;&#x95F4;&#x51CF;1&#x5C0F;&#x65F6;&#x3002;&#x4E0E;now()&#x505A;&#x8BA1;&#x7B97;&#x6765;&#x51B3;&#x5B9A;&#x65F6;&#x95F4;&#x8303;&#x56F4;&#x7684;&#x53EF;&#x9009;&#x5355;&#x4F4D;&#x6709;&#xFF1A;</p>
<table>
<thead>
<tr>
<th>&#x5B57;&#x6BCD;</th>
<th>&#x610F;&#x601D;</th>
</tr>
</thead>
<tbody>
<tr>
<td>u&#x6216;&#xB5;</td>
<td>&#x5FAE;&#x79D2;</td>
</tr>
<tr>
<td>ms</td>
<td>&#x6BEB;&#x79D2;</td>
</tr>
<tr>
<td>s</td>
<td>&#x79D2;</td>
</tr>
<tr>
<td>m</td>
<td>&#x5206;&#x949F;</td>
</tr>
<tr>
<td>h</td>
<td>&#x5C0F;&#x65F6;</td>
</tr>
<tr>
<td>d</td>
<td>&#x5929;</td>
</tr>
<tr>
<td>w</td>
<td>&#x661F;&#x671F;</td>
</tr>
</tbody>
</table>
<p>InfluxQL&#x8FD8;&#x652F;&#x6301;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;&#x8868;&#x8FBE;&#x5F0F;&#x4E2D;&#x7684;&#x8FD0;&#x7B97;&#x7B26;&#xFF0C;<code>SHOW</code>&#x8BED;&#x53E5;&#x548C;<code>GROUP BY</code>&#x8BED;&#x53E5;&#x3002;&#x6709;&#x5173;&#x8FD9;&#x4E9B;&#x4E3B;&#x9898;&#x7684;&#x6DF1;&#x5165;&#x8BA8;&#x8BBA;&#xFF0C;&#x8BF7;&#x53C2;&#x9605;&#x6211;&#x4EEC;&#x7684;<a href="">&#x6570;&#x636E;&#x63A2;&#x7D22;</a>&#x9875;&#x9762;&#x3002; InfluxQL&#x529F;&#x80FD;&#x8FD8;&#x5305;&#x62EC;<code>COUNT</code>&#xFF0C;<code>MIN</code>&#xFF0C;<code>MAX</code>&#xFF0C;<code>MEDIAN</code>&#xFF0C;<code>DERIVATIVE</code>&#x7B49;&#x3002; &#x6709;&#x5173;&#x5B8C;&#x6574;&#x5217;&#x8868;&#xFF0C;&#x8BF7;&#x67E5;&#x770B;<a href="">&#x51FD;&#x6570;</a>&#x9875;&#x9762;&#x3002;</p>
<h2 id="&#x4E3A;&#x4EC0;&#x4E48;influxdb&#x4E0D;&#x662F;crud&#x7684;&#x4E00;&#x4E2A;&#x89E3;&#x91CA;">&#x4E3A;&#x4EC0;&#x4E48;InfluxDB&#x4E0D;&#x662F;CRUD&#x7684;&#x4E00;&#x4E2A;&#x89E3;&#x91CA;</h2>
<p>InfluxDB&#x662F;&#x9488;&#x5BF9;&#x65F6;&#x95F4;&#x5E8F;&#x5217;&#x6570;&#x636E;&#x8FDB;&#x884C;&#x4E86;&#x4F18;&#x5316;&#x7684;&#x6570;&#x636E;&#x5E93;&#x3002;&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x901A;&#x5E38;&#x6765;&#x81EA;&#x5206;&#x5E03;&#x5F0F;&#x4F20;&#x611F;&#x5668;&#x7EC4;&#xFF0C;&#x6765;&#x81EA;&#x5927;&#x578B;&#x7F51;&#x7AD9;&#x7684;&#x70B9;&#x51FB;&#x6570;&#x636E;&#x6216;&#x91D1;&#x878D;&#x4EA4;&#x6613;&#x5217;&#x8868;&#x7B49;&#x3002;</p>
<p>&#x8FD9;&#x4E2A;&#x6570;&#x636E;&#x6709;&#x4E00;&#x4E2A;&#x5171;&#x540C;&#x4E4B;&#x5904;&#x5728;&#x4E8E;&#x5B83;&#x53EA;&#x770B;&#x4E00;&#x4E2A;&#x70B9;&#x6CA1;&#x4EC0;&#x4E48;&#x7528;&#x3002;&#x4E00;&#x4E2A;&#x8BFB;&#x8005;&#x8BF4;&#xFF0C;&#x5728;&#x661F;&#x671F;&#x4E8C;UTC&#x65F6;&#x95F4;&#x4E3A;12:38:35&#x65F6;&#x6839;&#x636E;&#x4ED6;&#x7684;&#x7535;&#x8111;CPU&#x5229;&#x7528;&#x7387;&#x4E3A;12&#xFF05;&#xFF0C;&#x8FD9;&#x4E2A;&#x5F88;&#x96BE;&#x5F97;&#x51FA;&#x4EC0;&#x4E48;&#x7ED3;&#x8BBA;&#x3002;&#x53EA;&#x6709;&#x8DDF;&#x5176;&#x4ED6;&#x7684;series&#x7ED3;&#x5408;&#x5E76;&#x53EF;&#x89C6;&#x5316;&#x65F6;&#xFF0C;&#x5B83;&#x53D8;&#x5F97;&#x66F4;&#x52A0;&#x6709;&#x7528;&#x3002;&#x968F;&#x7740;&#x65F6;&#x95F4;&#x7684;&#x63A8;&#x79FB;&#x5F00;&#x59CB;&#x663E;&#x73B0;&#x7684;&#x8D8B;&#x52BF;&#xFF0C;&#x662F;&#x6211;&#x4EEC;&#x4ECE;&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x91CC;&#x771F;&#x6B63;&#x60F3;&#x8981;&#x770B;&#x5230;&#x7684;&#x3002;&#x53E6;&#x5916;&#xFF0C;&#x65F6;&#x95F4;&#x5E8F;&#x5217;&#x6570;&#x636E;&#x901A;&#x5E38;&#x662F;&#x4E00;&#x6B21;&#x5199;&#x5165;&#xFF0C;&#x5F88;&#x5C11;&#x66F4;&#x65B0;&#x3002;</p>
<p>&#x7ED3;&#x679C;&#x662F;&#xFF0C;&#x7531;&#x4E8E;&#x4F18;&#x5148;&#x8003;&#x8651;create&#x548C;read&#x6570;&#x636E;&#x7684;&#x6027;&#x80FD;&#x800C;&#x4E0D;&#x662F;update&#x548C;delete&#xFF0C;InfluxDB&#x4E0D;&#x662F;&#x4E00;&#x4E2A;&#x5B8C;&#x6574;&#x7684;CRUD&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x66F4;&#x50CF;&#x662F;&#x4E00;&#x4E2A;CR-ud&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="glossary.html" class="navigation navigation-prev " aria-label="Previous page: 专业术语">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="insights_tradeoffs.html" class="navigation navigation-next " aria-label="Next page: InfluxDB的设计见解和权衡">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"与SQL比较","level":"1.4.3","depth":2,"next":{"title":"InfluxDB的设计见解和权衡","level":"1.4.4","depth":2,"path":"Concepts/insights_tradeoffs.md","ref":"Concepts/insights_tradeoffs.md","articles":[]},"previous":{"title":"专业术语","level":"1.4.2","depth":2,"path":"Concepts/glossary.md","ref":"Concepts/glossary.md","articles":[]},"dir":"ltr"},"config":{"plugins":["comment"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"comment":{"highlightCommented":true},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"github":"jasper-zhang/influxdb-document-cn","theme":"default","author":"jasper","pdf":{"pageNumbers":true,"fontSize":16,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"InfluxDB中文文档","language":"en","links":{"sidebar":{"InfluxDB中文文档":"https://legacy.gitbook.com/book/jasper-zhang1/influxdb"},"gitbook":true},"gitbook":"*","description":""},"file":{"path":"Concepts/crosswalk.md","mtime":"2019-09-29T09:05:38.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-29T09:10:37.143Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-comment/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

